import 'package:umeng_vertify/u_m_token_entity.dart';

uMTokenDataFromJson(UMTokenData data, Map<String, dynamic> json) {
	if (json['carrierFailedResultData'] != null) {
		data.carrierFailedResultData = json['carrierFailedResultData'].toString();
	}
	if (json['code'] != null) {
		data.code = json['code'].toString();
	}
	if (json['msg'] != null) {
		data.msg = json['msg'].toString();
	}
	if (json['requestCode'] != null) {
		data.requestCode = json['requestCode'] is String
				? int.tryParse(json['requestCode'])
				: json['requestCode'].toInt();
	}
	if (json['requestId'] != null) {
		data.requestId = json['requestId'].toString();
	}
	if (json['token'] != null) {
		data.token = json['token'].toString();
	}
	if (json['vendorName'] != null) {
		data.vendorName = json['vendorName'].toString();
	}
	if (json['resultCode'] != null) {
		data.resultCode = json['resultCode'].toString();
	}
	return data;
}

Map<String, dynamic> uMTokenDataToJson(UMTokenData entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['carrierFailedResultData'] = entity.carrierFailedResultData;
	data['code'] = entity.code;
	data['msg'] = entity.msg;
	data['requestCode'] = entity.requestCode;
	data['requestId'] = entity.requestId;
	data['token'] = entity.token;
	data['vendorName'] = entity.vendorName;
	data['resultCode'] = entity.resultCode;
	return data;
}